Skip to main content

Full text of "SYNTAX ZX80 Vo1. 1 No. 2"

See other formats


SYNTAX ZX80' 

A PUBLICATION OF THE HARVARD GROUP 


VOL. 1 NO. 2 REPRINT ISSN 0273-2696 1980 


NEW NEW 8K ROM PLUS PRINTER 

Last month we announced a new 
8K ROM chip from Sinclair for 
about the first of the year. Now 
Sinclair is revamping that chip. 
The new -chip will support the low 
cost printer Sinclair plans to 
introduce next year. Sinclair 
expects to retain all previously 
announced functions and price. 
Redesigning will delay production 
a few weeks . 


AUTHORIZED SOFTWARE 

Image Computer Products of 
Northbrook, IL, is the authorized 
ZX80 software producer. They are 
a division of The Image Producers, 
Inc. , an advertising and marketing 
agency. Besides ZX80 software, 
Image writes for Apple II, TRS-80, 
Sorcerer and Atari microcomputers. 

Dick Schultz, sales manager, 
says Image offers primarily game 
cassettes and some utility and 
math tapes. A cassette contains 2 
to 4 programs and comes with an 
instruction manual containing 
listings and flowcharts for $6.95. 

In cooperation with Sinclair 
Research, Image now offers a ZX80 
Computer Learning Lab, a system of 
self-paced computer programs and 
workbook lessons, designed for an 
interactive learning experience. 
New computer owners can learn 
problem-solving and programming in 
a hands-on approach. 

Both the Learning Lab and a 
complete ZX80 are available from 
Sinclair by mail for $249. Image 
sells the Learning Lab alone for 
$49.95 — see catalog for details. 


SOFTWARE CATALOGS AVAILABLE 

Software catalogs from Image 
Computer Products are hot off the 
presses and available to ZX80 and 
MicroAce owners. 

New ZX80 owners will find the 
catalog packed with their machine. 
Owners who bought their ZX80 ' s 
before the catalog was printed 
will receive them in the mail from 
Sinclair Research. MicroAce 
owners can get a copy by writing 
to Image Computer Products, 615 
Academy Dr., Northbrook, IL, 

60062, or calling 312/564-5060. 

SINCLAIR SHIPMENTS PICK UP 

Sinclair caught up with their 
ZX80 shipping schedule in November 
because production rates are up to 
meet the demand. What does this 
mean to ZX80 owners? If you must 
return your ZX80 for replacement 
under warranty, expect to receive 
your new machine much faster than 
you old one. According to Nigel 
Searle of Sinclair, shipments now 
turn around on a one day schedule, 
so your new ZX80 will go right out 
the door. 

8K ROM PROGRAMS HERE ! ! 

Next month we'll bring you 
tested and debugged programs to 
run with the new 8K ROM. Our 
technical staff has the only 
prototype 8K ROM in the U.S. and 
we're wording on programs so you 
will be able to use your new ROM 
immediately. We're especially 
impressed by the graphics 
capability and the PLOT-DRAW- 
PRINT sequence. 


1 


NEW MODEM 

MicroPeripheral Corp. will 
introduce a modem for ZX80 and 
MicroAce machines by 1 January 
1981, enabling you to connect to 
other computers by telephone. The 
computer turns its electrical 
signals into tones which are 
carried through the phone lines. 

Unlike most modems, this one 
will plug right into the telephone 
jack, so it needs no acoustic 
coupler. Direct connection gives 
you clearer signal reception and 
transmission. 

Acoustic couplers attach to 
the telephone handset and transmit 
sound. Unfortunately, the modem 
will transmit any sound it hears, 
including background noise. 

MicroPeripheral ' s modem 
works at 300 baud (30 characters 
per second) in both answer and 
originate modes . An interface 
decodes the bus on the chassis 
rear, eliminating the need for an 
RS232 adapter. 

Perhaps the most exciting use 
for this new accessory, according 
to Don Stoner of MicroPeripheral, 
is becoming part of the giant 
nation-wide computer networks such 
as The SOURCE or Micronet. You 
can access government data bases 
like the National Health Library 
in Bethesda, or free public 
bulletin boards. These systems 
are compatible between several 
kinds of computers , so you can 
communicate with a vast number o f 
people and machines. For a list 
of regional systems, write to: 

Donald Stoner 

Customer Service 

MicroPeripheral Corp. 

Box 529 

Mercer Island, WA 98040 
(More information about The SOURCE 
and Micronet in a later issue.) 


At press time, Sinclair has 
16K RAMs in production, available 
in January after FCC approval. 


EXTENDED ZX80 SERVICE CONTRACTS 

Sinclair now offers extended 
service contracts to ZX80 owners . 
$25 per year will cover all parts 
and labor and return shipment of 
the unit. (You ship the machine 
prepaid to Sinclair and they pay 
the return postage.) For further 
information, contact Sinclair 
Research Ltd, 50 Staniford St. , 
Boston, MA, 02114. 

OUR POLICY ON CONTRIBUTED MATERIAL 

SNYTAX ZX80 invites you to express opinions 
related to the ZX80 and the newsletter. We will print, 
as space allows, letters discussing items of general 
interest. Of course, we reserve the right to edit letters 
to a suitable length and to refuse publication of any 
material. 

We welcome program listings for all levels of 
expertise. Programs can be for any fun or useful 
purpose. We will test run each one before publishing 
it, but we will not debug programs; please send only 
workable listings. 

In return for your listing, we will pay you a token 
fee of $2.00 per program we use. This payment gives 
us the nonexclusive right to use that program in any 
form, world-wide. This means you can still use it, sell 
it, or give it away, and so can we. 

We will consider submissions of news and 
hardware or software reviews. Please keep articles 
short (50-100 words). Again, we reserve the right to 
edit accepted articles to a suitable length. We will pay 
7 cents per 6 characters, including spaces and 
punctuation, for accepted articles. 

If you want us to return your original program 
listing or article, please include a self-addressed, 
stamped envelope. Otherwise, we cannot return 
submitted material. 


SYNTAX ZX80 is published monthly by 

The Harvard Group, RD 2, Box 457, Bolton Road, 
Harvard, MA 01451. Telephone 617 / 456-3661. 
Subscription rates: 12 issues, $25. 

Single issues, $4 each. 

© The Harvard Group, 1980. All rights reserved. 
Photocopying prohibited. 

SYNTACTIC SUM™ is a trademark of 
Syntax ZX80 , Inc. , and The Harvard 
Group. All rights reserved. 


2 


MULTIPLICATION EXERCISE 

This is a program I wrote to 
help my daughter practice her 
multiplication. It asks for the 
multiplier (any number up to 3276) 
and then presents 5 problems, 
randomly choosing a number from 1 
to 10. You get two tries to 
answer correctly. After the 
second try, the machine gives you 
the right answer with the next 
problem. At the end, it displays 
the number correct and then you 
can re-execute the program. This 
program uses IK memory, so you can 
add more descriptive information 
as memory becomes available. 

10 PRINT "HI. WHAT IS YOUR 
NAME?" 

20 INPUT A$ 

30 CLS 

40 PRINT "OK, ";A$ ; " ENTER 
MULTIPLIER. " 

50 INPUT A 
60 LET B=0 
70 DIM X(5) 

80 FOR J=1 TO 5 
90 LET C=RND(100) 

100 IF C>10 THEN LET C=C/10 

110 LET X(J-1)=C 

120 GO SUB 500 

130 INPUT E 

140 FOR L=1 TO 2 

150 PRINT E 

160 PRINT "THAT IS "; 

170 IF NOT E=A*C THEN PRINT "IN 

» l 

i80 PRINT "CORRECT" 

190 IF E=A*C THEN GO TO 250 
200 IF L=2 THEN GO TO 260 
210 PRINT "PLEASE TRY AGAIN." 

220 INPUT E 
230 GO SUB 500 
240 NEXT L 
250 LET B=B+1 

260 PRINT "PRESS (NEWLINE) TO C 
ONTINUE" 

270 INPUT B$ 

280 NEXT J 
285 LET J=J-1 
290 GO SUB 500 
300 P&INT A*X(4) 

310 IF B >1 THEN GO TO 340 
320 PRINT "BETTER TRY AGAIN, 


330 

340 

350 

360 

370 

380 


390 

*Tt I f 

400 

410 

420 

430 

440 

0 


GO TO 380 

IF B 5 THEN GO TO 370 
PRINT "EXCELLENT, "; 

GO TO 380 

PRINT "NOT BAD, "; 

PRINT A$ 

PRINT "YOU GOT ”;B;" CORREC 

INPUT B$ 

CLS 

PRINT "WANT TO TRY AGAIN?" 
INPUT B$ 

IF CODE(B$)=62 THEN GO TO 3 


450 CLS 

460 PRINT "OK, ";A$;". THANKS 
FOR" 

470 PRINT "PLAYING WITH ME." 

480 PRINT "SEE YOU NEXT TIME." 
490 STOP 
500 CLS 

510 PRINT "MULTIPLY BY ";A 
520 FOR K=1 to J 
530 PRINT X(K-l);" X ";A;" = "; 
540 IF NOT K=J THEN PRINT X(K-1 
)*A 

550 NEXT K 
560 RETURN 

SYNTACTIC SUM = -5144 


Pete Cone, Davenport, IA 


Image Computer Products wants 
people to write ZX80 programs. For 
author's guide, contact A1 Baker, 
program director at Image. 


MAKE -DO CONNECTORS 

At SYNTAX we use a Radio Shack 
connector. Their solderless edge- 
card, 40-pin connector (#276-1558) 
usually picks up all the contacts 
we need. We also use 40- conductor , 
insulation displacement, ribbon 
cable and mount the connector with 
a metal- jawed vise. We open .the 
connector ends with a small burr in 
a hobby grinder. (Put a piece of 
ciSPtuit board between the contacts 
to prevent damage while cutting 
end slots.) We terminate the 

cable with an experimenter board 
so we can simply plug into the 
contact strips with wire jumpers 
to the prototype board. 


3 


CASSETTE EAVESDROPPER 


Use this simple circuit to 
listen to your programs as they 
save and load or to search for 
programs on tape without pulling 
the earphone cord and adjusting 
the volume control each time. 

The circuit consists of one 
3.5 mm (0.125 inch) phone plug 
wired to a 3.5 mm miniature phone 
jack with another 3.5 mm phone 
jack wired in parallel through a 
1KX1 resistor . Build it into any 
type of holder (a Radio Shack 
project box is neat and 
inexpensive) , although a metal 
housing helps avoid TV 
interference. Using a small 
coaxial cable (rather than 
separate conductors) for the wire 
to the cassette plug further 
avoids interference. 

Once you build the device, 
plug the phone plug into the 
cassette earphone jack, an 
earphone into the jack with the 
resistor ^ and the ZX80 into the 
other jack. Now you can listen to 
your tapes through the earphone 
with the volume set to maximum, 
even if the ZX80 is listening too. 


TIP 

RING 


lKOhm > 
\ Watt > 


To cassette 
ear jack 

O TIP 

RING 




TIP RING 


Paul Holzchuher called to 
tell a strange story. His ZX80 
worked fine on the dining room 
table, but on an aluminum table 
it wouldn't load prerecorded or 
newly recorded tapes. Raising it 
off the table with books was no 


help. A wooden table cured the 
oroblem. When you have trouble 
reloading programs , move your ZX80 
to a non-conducting surface. 


SEASON'S GREETINGS 


Here is our personalized 
holiday greeting to you, courtesy 
of your.ZX80 or MicroAce. With a 
little clever substitution in 
lines 450- 640, you can adapt this 
listing to produce your own video 
Christmas card. 

49 GO TO 100 

50 FOR 1=1 to LM 
60 PRINT " 

70 NEXT I 
80 RETURN 
99 STOP 

100 FOR N=2 TO 16 
110 LET M=2* (N/2) - 1 
120 LET LM=16-M 
130 GO SUB 50 

140 FOR J=16-M+l to 16+M-l 
150 LET Y=51+RND(M) 

160 IF Y=52 THEN LET X=Y 
170 IF Y>52 THEN LET X=Y-51 
180 IF Y>62 THEN LET X=222 
190 PRINT CHR$ (X) ; 

200 NEXT J 
210 PRINT " " 

220 NEXT N 
400 LET LM=15 
410 GO SUB 50 
420 PRINT "U" 

450 LET A$="Z" 

465 LET D$="TAX" 

480 LET K$="0" 

485 LET N$=" " 

500 LET LM=9 
510 GO SUB 50 

520 PRINT "HAPPY HOLIDAYS" 

530 LET LM=12 
540 GO SUB 50 

560 PRINT "A";A$;N$;"K";K$;N$;" 
E" ; K$ 

580 LET LM=13 
590 GO SUB 50 
600 PRINT "SYN";D$ 

620 LET LM=14 
630 GO SUB 50 
640 PRINT A$ ; "X" ; 5*4**2 
SYNTACTIC SUM = -27631 


4 


COMPU- CALENDAR 


This three-part program 
returns correct day name, changes 
Gregorian dates to corresponding 
Julian day numbers , and computes 
total days between any two dates 
from Jan. 1 AD to Feb. 2300. 

To use, type the month number 
(NL) , day number (NL) , and four- 
digit year (NL) . ZX80 returns the 
correct day name, followed by a 
prompt. Type J (NL) and it prints 
the equivalent Julian day number. 
(Julian days begin at GMT noon on 
each day and count days from noon, 
January 1, 4713 BC.) 

You can also calculate the 
number of days between two dates . 
Enter the earlier one first, using 
J (NL) to compute JD, then enter 
the second date but just hit (NL) 
instead of J (NL) to request total 
days between the 2 dates. 

Note that the ZX80 correctly 
reads out JD numbers in millions , 
thousand and units, but blanks 
leading zeros in each group. When 
reporting total days , sometimes 
the program displays thousands of 
days as 1000 too high, followed by 
negative hundreds; just add them. 
For example: A read out of 2,-825 
means total days = 1,175. 

To exit the program, enter 
numeral zero (NL) as the month. 

Otis Imboden, Washington, D.C. 

Note : This program takes leap 

years into account, but as written 
cannot display them. — AZ 

10 PRINT "COMPU- CAL" 

15 CLEAR 

20 PRINT "ENTER MO /DY/ YEAR" 

30 INPUT M 
40 IF M=0 THEN STOP 
50 INPUT D 
55 INPUT Y 
57 CLS 

62 PRINT "YOUR DATE (" ; M; ; D; 

' t / M . Y«. " ) . 

68 IF Y<1900 OR (Y=1900 AND M< 

3) THEN LET D=D+1 


69 IF Y "1800 OR (Y=1800 and M< 
3) THEN LET D=D+1 

70 IF M>2 THEN GO TO 90 
80 LET Y=Y- 1 

85 LET M=M+13 
87 GO TO 91 

90 LET M=M+1 

91 IF Y>2199 THEN LET D=D- 1 
93 IF Y >2099 THEN LET D=D-1 

100 LET A=Y*3+7200 

110 LET B=(Y*6)+(M*3)+98 

120 LET C=(Y*5)+((M*6)/10) 

130 LET D=D+(Y/4)+C+2 

135 LET L=l+A/ 10000 

136 LET A=A- (10000* (A/ 10000) ) 
145 LET T=(A/10)+(B/100)+(D/100 

0) 

147 LET U=(100*(A-10*(A/10)))+( 
10*(B-(100*(B/100)))+(D-1000*(D/ 
1000 ))) 

148 LET T=T+U/ 1000 

149 LET U=U- (1000- (U/ 1000)) 

150 LET Z=2+L+(T*-1)+U 
155 LET Z=Z-(7*(Z/7)) 

157 IF Z<0 THEN LET Z=Z+7 

158 GO SUB (Z*2)+160 

159 GO TO 179 

160 PRINT "SATUR"; 

161 RETURN 

162 PRINT "SUN"; 

163 RETURN 

164 PRINT "MON"; 

165 RETURN 

166 PRINT "TUES"; 

167 RETURN 

168 PRINT "WEDNES"; 

169 RETURN 

170 PRINT "THURS"; 

171 RETURN 

172 PRINT "FRI"; 

173 RETURN 

174 GO TO 160 
179 PRINT "DAY" 

181 INPUT J$ 

182 IF J$="J" THEN GO TO 195 

186 IF T-S<1 THEN GO TO 188 

187 PRINT T-S;","; 

188 PRINT U-W;" TOTAL DAYS" 

190 GO TO 15 

195 LET S=T 
197 LET W=U 

199 PRINT " JD=" ; L ; " , " ; T ; " , " ; U 
210 GO TO 20 
SYNTACTIC SUM = 22279 


5 



COMPARISON BETWEEN THE SINCLAIR ZX30 AND THE TRS-80 COLOR COMPUTER 


ITEM 

SINCLAIR : 

ZX80 

TRS-80 COLOR 

SINCLAIR W/8K ROM 

Price 

$200 


$400 

$240 

Max size of array 

255 


mem- limit 

mem- limit 

Max # of dimensions 

1 


1 

mem- limit 

Digits of accuracy 

5 integer 


9 floating 

9 . 5 floating 

Range of numbers 

+/- 32767 


IE- 38 to IF, +38 

9E-44 to 1. 1E+43 

Max string length 

mem- limit 


255 

mem- limit 

Max size str array 

no string 

arrays 

mem- limit 

mem- limit 

# of str dimensions 

no string 

arrays 

1 

mem- limit 

# unique var names 

mem- limit 


936 

mem- limit 

# unique str names 

26 


936 

26 

Range of state #'s 

1-9999 


0-63999 

1-9999 

Comma spacing 

8 


16 

16 

# of comma fields 

4 


2 

2 

Str. data req "'s 

no data stmnt 

no 

yes 

Filenames (length) 

no 


8 

mem- limit 

Display size 

25 x 32 


16 x 32 

22x32 

Editor type 

1 line scrn 6c list 

none 

1 line scrn 6c lis 

Point of E switch 

none 


1 E-3 6c 1 E+9 

1 E-6 6c 1 E+13 

Use DEG/ RAD/ GRAD 

none 


RAD 

RAD 

Printer available? 

no 


yes 

yes 

Graphics resolution 

none 


64 x 32 

64 x 44 

Graphics origin 

none 


top left 

bottom left 

Colors available? 

no 


8 

no 

Joysticks avail? 

no 


yes 

no 

String concat 

no 


yes (+) 

yes (+) 

Cassette data I/O 

no 


yes 

no 

Mult stmnts/line 

no 


yes (:) 

no 

Uses ASCII 

no 


yes 

no 

Display w/o stop 

no 


yes 

yes 

Kbd readable 

no 


yes 

yes 

Protectable memory 

no 


yes 

yes 

Internal clock 

p&p 


no 

P&P 

ARE THE FOLLOWING FUNCTIONS INCLUDED? 



** or uparrow 

X 



X 

ABS & INT 6c SGN 

ABS only 


X 

X 

NOT & AND 6c OR 

X 


X 

X 

SIN 6c COS 



SIN only 

X 

FRE/ FREE /MEM 



X 

X 

VAL 



X 

X 

LEN 



X 

X 

SEG$/MID$ or equiv. 



X 

X 

LEFT$ 6c RIGHT$ 



X 

X 

TAB 



X 

X 

EOF 



X 


TAN 6c ATN 




X 

ASN 6c ACS 




X 

LOG/LN 




LN 

EXP 6c SQR/SQRT 




X 

PI 




X 

POINT 



X 


JOYSTK 



X 



6 


ITEM 


SINCLAIR ZX80 


TRS-80 COLOR SINCLAIR W/8K ROM 


ARE THE FOLLOWING STATEMENTS SUPPORTED? 


RANDOMIZE X NOT NEEDED 

FOR with STEP X 

GET/INKEY$ X 

PRINT AT X 

READ & DATA X 

RESTORE X 

PLOT/ SET X 

UNPLOT/ RESET X 

INPUT# /PRINT# X 

OPEN X 

CLOSE X 

AUDIO ON/OFF X 

ON . . . GOSUB X 

ON . . . GOTO X 

IF. . .THEN. . .ELSE X 

END X 

SOUND (make noise) X 


PRINT USING/TO 
WAIT (time delay) 
DRAW/ LINE 
UNDRAW/ UNLINE 
PAUSE 
SCROLL 


X 

X 

X 

X 

X 

X 

X 

X 


X 

X 

X 

X 

X 

X 


ARE THE FOLLOWING COMMANDS SUPPORTED? 

LLIST X 
SKIPF X 
MOTOR ON /OFF X 


ALL THREE MACHINES USE: 

* String comparisons in an IF statement 

* Immediate mode 

* Dynamic DIM 

* Double quotes (") for literal strings 

* An output line width of 32 characters 

* Operators + , *, and / 

* LET , PRINT , INPUT , GOTO , IF . . . THEN , GOSUB , RETURN , 
FOR... NEXT, STOP, CLEAR/CLR, CLS , and REM statements 

* PEEK, POKE, USR/EXEC , ASC/CODE, CHR$ , and STR$ function 

* RUN, CONTINUE, LIST, NEW, SAVE, and LOAD commands 

» 

NONE OF THE MACHINES USE: 

* MAT statements 

* High speed cassette search 

* Available floppy disks 


NOTE: A / between choices 
indicates either fulfills 
category, while & requires both. 


NOTE: P&P indicates tnat a simple 
PEEK and POKE operation performs a 
function not supported in system. 

7 


KEY TO COMPARISON CHARTS 


• Range of numbers — greatest and 
smallest no. system can express. 

• Output line width — greatest 
no. of characters on one output 
display line. 

• Comma spacing — width of comma 
print fields . 

• # of comma fields — no. of 
comma print fields across one 
display line. 

• Str data req "'s — do strings 

in data statements require quotes? 

• Editor type — what kind of 
editor does system use? (1 line 
scrn means a single line screen 
editor, list means listing is on 
screen while editing. ) 

• Point of E switch — no. at 
which system switches to display 
in scientific notation. 

• Use DEG/RAD/GRAD — how does 
system measure angles? 

• Graphics resolution — using 
system plot commands (4K & program 
can plot 64 x 48 from top left) . 

• String concat — can system 
append one string to another? 

• Cassette data I/O — can system 
store data (as opposed to 
programs) on cassette tape? 

• Uses ASCII — does system use 
American Standard Code for 
Information Interchange? 

• Display w/o stop — can system 
display something and continue 
without any user interaction? 

• Display size — height and width 
of display in characters. 

• Kbd readable — can system read 
keyboard without stopping? 

• Protectable memory — can a 
section of memory be protected so 
that machine language programs may 
be stored there? 

• USR/EXEC — equivalent 
functions, transfer control to a 
machine language program. 

• POINT — returns whether or not 

a certain graphics point is lit on 
the screen. 

• FRE/ FREE /MEM — return amount of 
memory not used by program. 


• RANDOMIZE — reseeds random 
number generator. 

• PRINT USING/TO— print no. 
according to a specific format. 

• FOR with STEP — extended form 
of a FOR... NEXT statement to 
specify an increment. 

• END — signals end of program. 

• BEEP — tells system to sound a 
beeper to notify user. 

• SOUND — tells the system to 
make one of 255 sounds. 

• GET/ INKEY$— read keyboard 
without stopping. 

• PRINT AT — prints information 
at a certain screen position. 

• WAIT — pause for a certain 
programmable length of time. 

• READ & DATA — reads nos . or 
strings from list of information 
after DATA statement and puts it 
in variables. 

• RESTORE — resets data list so 
same data may be read in again. 

• DRAW — draws a line on screen. 

• PLOT/ SET — turns on screen 
pixel . 

• UNDRAW — opposite of DRAW. 

• UNPLOT/RESET —opposite of PLOT. 

• INPUT # — reloads all variables 
in mempry from tape. 

• PRINT # — stores all variables 
in memory on tape. 

• PAUSE — causes program to stop 
for a moment and display output. 

• SCROLL — causes all lines on 
screen to move up one. 

• SAVE/CSAVE — stores program on 
cassette tape. 

• LOAD/CLOAD — reloads program 
from cassette tape. 

• SKIPF — skips a file on tape. 

% 

• Dynamic DIM — array sizing 
using a variable: DIM A(G) . 


Syntactic Sums are an easy 
way to check your program 
typing for errors. Look 
for our Syntactic Sum 
program in SYNTAX, Feb. 81. 


8 



DEAR EDITOR: 

The ZX80's black-on-white 
video output is somewhat hard to 
read. Most computers have a black 
background with white letters. 

There is a simple way to reverse 
the ZX80 video output. 

The video input to the RF 
modulator comes from an exclusive 
OR gate. One input to this gate 
is the sync signal and the other 
is the data. The data input comes 

from pin 7 of_ IC9 , a 74LS165. 

This is the Q output of the 
parallel to serial converter. On 
the bottom side of the PC board 
near IC9 are 3 points marked A, B, 
and C. A goes to the exclusive OR 
gate, B to the Q output_(pin 9) of 
IC9 , and C goes to the Q (inverted) 

output (pin 7) . Presently 
A is connected to C. To reverse 
the output, break the connection 
between A and C and make a new one 
between A and B. Or you could 
install a switch to switch between 
the 2 different outputs. 

Thanks for your magazine. It 
should be a big help to all ZX80 
owners in the future. 

Brent Dix, Cedar City, UT 

■ 4r ■ ■ . . . . 

Here is a TAB subroutine 
listing. It causes the display to 
tab to any column, 1-32 left to 
right. Just give COLTAB a value 
corresponding to the desired 
column number and insert a 
subroutine call in your program. 

900 GO TO 2000 
999 REM TAB 

1000 IF COLTAB >32 THEN RETURN 
1005 LET ITAB=PEEK(16420) - (34-CO 
LTAB) 

1010 IF PEEK(16420) <2 THEN LET I 
TAB=33- (34- COLTAB) 

1015 IF ITAB < 1 THEN RETURN 
1020 LET JTAB=1 
1030 PRINT " " ; 

1040 IF JTAB=ITAB THEN RETURN 
1050 LET JTAB=JTAB+1 
1055 GO TO 1030 


1060 REM AS CONTINUING PART OF 

1061 REM "PRINT ; " "GO SUB 1000" 

1062 REM CAUSES TAB TO COLUMN 

1063 REM IN "COLTAB" (1-32, 

1064 REM LEFT TO RIGHT) 

1065 REM "COLTAB NOT CLEARED. 

1066 REM "COLTAB" MUST ALLOW 

1067 REM SPACE FOR ALL 

1068 REM INFORMATION PRINTED. 

2000 STOP 

(Listing appears exactly as on a 
TV screen. In line 1005, COLTAB 
is one word, as is ITAB in line 
1010. --AZ) 

To add another tab setting, 
add a ; to the end of your first 
print command, then assign another 
value to COLTAB. Insert another 
GO SUB and PRINT statement and the 
display will print in two columns. 

William Herron, San Diego, CA 

- - - - I,----. - ■ 

I have an engineering 
background but am a raw beginner 
when it comes to computers. Could 
you put me in touch with other 
San Diego area ZX80 owners so that 
I could contact them to exchange 
ideas and questions? 

H.S. Wake, San Diego, CA 

714/455-1370 

To respect your privacy, we will 
not print subscriber names and 
numbers, unless you request that 
your name or number appear. --AZ) 


Congratulations on the first 
issue of SYNTAX ZX80. My ZX80 
programs just fit in memory, but 
there is not enough left to handle 
variables or display. Machine 
language programs run faster and 
use less memory, but I don't grasp 
the essentials of this method. 

How about an article or series on 
machine language? I look forward 
to future issues of SYNTAX. 

Mark Paulkus , New Britain, CT 
Coming up.--AZ 


9 


HOW TO WIRE A BIG KEYBOARD 

Although the ZX80 has many 
fine features, some people 
complain about the small pads of 
the touch keyboard that comes with 
it. But this is not a serious 
problem. The ZX80 uses a matrixed 
keyboard, so you can easily add a 
bigger, parallel keyboard. 

"Matrixed" means each key 
connects two wires, one for the 
key row, the other the key column. 
Sinclair's matrix uses 8 rows and 
5 columns which connect to 13 
readily available points on the 
circuit board. Two pins descend 
from each key: When you depress 
the key, the pins make electrical 
contact, connecting an IC pin with 
the anode of a diode. This tells 
the computer which key you hit. 

When you look for keyboards 
at electronic surplus houses , try 
to get these features : 

• exchangeable key caps. 

• molded block keyboards that 
come off circuit boards easily. 

• caps with changeable legends. 

• a circuit board matrix nearly 
matching the ZX80 matrix. 

Unless you're sure you can 
overcome the problems, avoid these 
keyboards : 

• mechanical types. 

• ASCII encoded. 

• separate switches on PC board. 

• Hall effect keys. 

• brushes wiping printed contacts. 

• capacitive keyboards. 

Just wire your big matrixed 
keyboard in parallel with the 
existing one. Use standard 
single-pole, normally open 
keyswitches. Wire duplicate keys, 
such as "shift," in parallel so 
both will function. If your big 
keyboard has a numeric pad, wire 
each switch in parallel with the 
number keys above the letter keys. 
Use a continuous length of 


wire-wrap wire to daisy-chain one 
contact of each switch in each 
column. Do the same for the other 
switch contact in each row. Just 
push the insulation aside using 
the stripper of a wire-wrap tool. 

All components are clearly 
labelled on the ZX80 board. You 
must: wire both pins for each key. 
On the following chart, D3--D10 
represent the anodes of the diodes 
on the front of the PC board. (Look 
for the diode symbol under the 
diodes. The anode is at the broad 
end of the triangle.) Looking at 
the top of IC10, the pin nearest 
the IC10 label is pin 1. Pin 16 
is directly across from pin 1. 

Connect your keyswitches as 
shown in the following diagram. 

As shown for key "1", each key 
connects to the line below it and 
the line to its right. That is, 
wire key 1 to diode 6 and to pin 
10 of IC10. 


1 

1 

2 

3 

i 

4 


8 

9 

1 

1 

4 

5 

6 

7 

0 

1 

1 

U— T\ 7 

DO 

Q 

r 

W 

E 

R 

T 

Y 

U 

I 

0 

P 


Du 

A- 

T\ / 

S 

D 

F 

G 

H 

J 

K 

L 

NEW 

Do 

~Pv Q 

D 4 

SHF 

tv n 

z 

X 

c' 

U 

. 1 

N 

M 


SPC 

Dy 

D3 

TCI 0 PI 

> 

:n 

1 L 

J 

4- 

1 

U 

i 

1 



DID 

IC10 PIN L 
IC10 PIN U 
IC10 PIN 1( 
IC10 PIN ( 

1 . . . 


) 

) 


3 



For quick removal, use eight 
spring-loaded test clips for diode 
connections and parallel IC10 with 
a 16-pin proto-clip. Ribbon cable 
makes a good-looking interconnect. 

ANSWER TO CRYPTOQUOTE PUZZLE 

"Who chooses to cotnpete with 
machines accepts the conditions of 
s lavery"- -Norbert Weiner 

lO 



SUBROUTINES— SUPER STEP-SAVERS 

Last month we talked about 
FOR-NEXT loops as a way to repeat 
steps. This time we'll look at 
subroutines, which tell the 
computer to repeat a series of 
steps each time you call them. 

Subroutines are mini- 
programs; they execute a series of 
steps apart from the main program. 
In essence, you tell the computer, 
"Go do those steps and then come 
back here and proceed with the 
main program." The ZX80 remembers 
where it was and returns to the 
following line after executing the 
subroutine. You can call the 
subroutine many times from your 
main program, but you need type it 
only once. 

Suppose you want to use the 
TAB subroutine listing on page 17. 
The subroutine is lines 999-1055, 
but you need a whole program to 
fit around it. Say you want to 
print a list of dollar figures as 
part of an accounting program you 
are writing. TAB only helps 
instruct the computer to display 
your data in tabular columns. You 
must still tell what to do with 
the data you enter. So when you 
get to line 140, where you want to 
display results in columns, call 
up TAB us ing GO SUB : 

140 GO SUB 999 

• 

The computer jumps to 999 and then 
executes steps until it hits the 
RETURN command, then hops back to 
the line after the GO SUB from 
which it left the main program. 
When you again want TAB, say at 
line 290, write: 

290 GO SUB 999 

Again, it executes steps 999 to 
1055 but this time it returns to 
the line following 290. TAB uses 
IF. . .THEN RETURN statements to 
jump back. Insert a RETURN at 
every endpoint of the subroutine. 


One more point : As the 
computer goes through the program 
steps, it eventually comes to line 
999 and tries to carry out the 
subroutine again. Trouble starts 
when it prints data you didn't 
want and then it hits RETURN and 
has no where to go. The ZX80 
gives you an error code 7 , meaning 
it Jiit a RETURN with no 
corresponding GO SUB. To avoid 
this, insert a jump (GO TO) step: 

900 GO TO 2000 

999 REM TAB 

1055 GO TO 1030 
2000 STOP 

Now the machine never runs into 
the subroutine unless directed 
there by a GO SUB because the GO 
TO in 900 causes it to jump over 
the subroutine to the STOP step. 

You can GO SUB backwards and 
forwards — the ZX80 can jump to a 
subroutine with a larger or 
smaller line number, so you can 
insert your subroutine anywhere in 
your program. Wherever you put 
it, remember the GO SUB, RETURN 
and GO TO steps. 

Use subroutines whenever you: 

• repeat 3 or more program lines. 

• reuse a complex line you might 
mistype .. 

• want 2 processing steps to 
always be identical. 

NEW MAGAZINE 

SYNC, published by Creative 
Computing , is due to hit the 
stands in January. Devoted to the 
Sinclair and MicroAce machines , 
SYNC will concentrate on software 
and applications, according to 
publisher Dave Ahl. Subscriptions 
are $10 for 6 issues, $15 Canadian 
and foreign surface. SYNC, 39 E. 
Hanover Ave., Morris Plains, NJ , 
07950 (800) 631-8112. 


To SAVE (and therefore LOAD) your 
programs faster, type CLEAR (NL) 
before saving. This tells the 
ZX80 not to save any variables. 

1 1 


BIG CHARACTER PROGRAM 


Make your video characters 8 
times bigger using ROM character 
images and substituting graphic 
symbols for screen dots. Change 
lines 140 & 160 for other symbols. 


5 

DIM C(4) 



7 

LET K=0 



10 

INPUT A$ 



11 

PRINT 



15 

LET K=K+1 



17 

IF K< 3 THEN GO 

TU 

20 

18 

CLS 



19 

LET K=1 



20 

FOR X=1 to 4 



30 

LET C (X) =C0DE (A$) 


40 

LET A$=TL$(A$) 



50 

NEXT X 



60 

FOR L=1 TO 8 



70 

FOR D=1 TO 4 



80 

LET Q=PEEK(C (D) 

*8+358 3+L) 

100 

LET B=8 



110 

LET B=B- 1 



115 

IF B<0 THEN GO 

TO 

200 

120 

IF Q<2**B THEN 

GO 

TO 160 

130 

LET Q=Q-2**B 



140 

PRINT CHR$ (128) 

% 

3 


150 

GO _ 110 



160 

PRINT ' " ; 



170 

GO TO 110 



200 

NEXT D 



210 

NEXT L 



220 

GO TO 10 




SYNTACTIC SUM = 25918 


Operation: RUN (NL) . Respond 

to Drompt with 4 characters & (NL) 
for 1st line. Next 4 letters go 
on 2nd line. Next 4 clear screen 
before printing on first line. To 
exit, hit (NL) break. 

ZX80 AND MICROACE BUS PINOUT 


PIN 

BOTTOM 

TOP 


23 

NC 

NOT 

REFSH 

22 

A4 

NOT 

Ml 

21 

A5 

NOT 

RESET 

20 

A6 

NOT 

BUSRQ 

19 

A7 

NOT 

WAIT 

18 

A8 

NOT 

BUSAK 

17 

A9 

NOT 

WR 

16 

A10 

NOT 

RD 

15 

All 

NOT 

IORQ 

14 

A12 

NOT 

MREQ 

13 

A13 

NOT 

HALT 

12 

A14 

NOT 

NMI 

11 

A15 

NOT 

INT 

10 

A3 

D4 ' 


9 

A2 

D3 ' 


8 

A1 

D5 ' 


7 

A0 

D6 ' 


6 

NOT CLOCK 

D2 ' 


5 

0 VOLT 

Dl' 


4 

0 VOLT 

DO' 


3 

SLOT 

SLOT 

2 

9 VOLT 

RAM 

CS 1 

1 

5 VOLT 

D7 ' 



Top is component side; bottom, 
solder side. This is a Z-80 bus. 




Tl-E 

H\RV\RD 

GROLP 

Bolton Road, Harvard, Mass. 01451 



CD